home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MACSHELL / MS1 / SAMPLES / USERMAIN.C < prev   
Text File  |  1992-12-02  |  4KB  |  122 lines

  1. /*
  2.  *    MacShell Source File
  3.  *
  4.  *    Copyright (c) 1989, 1990, 1991, 1992  Suick Bay Technologies.  All rights reserved.
  5.  *
  6.  *
  7.  *    RESTRICTIONS ON MacShell program and source code.
  8.  *
  9.  *    Ñ╩MacShell¬ is a product of Suick Bay Technologies and is provided for
  10.  *    restricted use by the owner of the CDROM "Disk to the future II".
  11.  *
  12.  *    Ñ╩No permission is granted for any commercial use without the written
  13.  *    consent of the Suick Bay Technologies.
  14.  *
  15.  *    Ñ╩No permission is granted for any redistribution of any kind use without
  16.  *    the written consent of the Suick Bay Technologies.
  17.  *
  18.  *    Ñ╩Permission is granted to use this for any personal noncommercial use.
  19.  *
  20.  *    Ñ╩You may not distribute source or executable code at all, nor may you 
  21.  *    distribute it with or within a commercial product without the written
  22.  *    consent of the Suick Bay Technologies.  Please send modifications to 
  23.  *    the author for inclusion in updates to the program.  Thanks.
  24.  *
  25.  *
  26.  *    MacShell¬ IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  27.  *    WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  28.  *    PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  29.  *
  30.  *    SUICK BAY TECHNOLOGIES SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  31.  *    INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY MACSHELL
  32.  *    OR ANY PART THEREOF. 
  33.  *
  34.  *    In no event will Suick Bay Technologies be liable for any lost revenue
  35.  *    or profits or other special, indirect and consequential damages, even if
  36.  *    Suick Bay Technologies has been advised of the possibility of such damages.
  37.  *
  38.  *    Suick Bay Technologies can be reached at:
  39.  *    
  40.  *    8768 Cottonwood lane
  41.  *    Maple Grove, MN 55369
  42.  *    Voice: (612) 425-7025
  43.  *    AppleLink: D5233
  44.  *    
  45.  *
  46.  *    No parts of this software may be reproduced or stored in a
  47.  *    retrieval system or transmitted in any form, or any means,
  48.  *    electronic, mechanical, photocopying, recording or otherwise,
  49.  *    without the prior written permission of Suick Bay Technologies.
  50.  *    
  51.  *    Spread the word and not the disk.
  52.  *    
  53.  *    SPK 012290    :    Initial
  54.  */
  55.  
  56. #include    <SegmentLdr.h>
  57.  
  58. #include    "SystemPub.h"
  59. #include    "Prefs.h"
  60. #include    "Cmds.h"
  61.  
  62. /*******************************************************************
  63.  *    This function is called after toobox init and before session
  64.  *******************************************************************/
  65.  
  66. UserMain()
  67. {
  68.     /* put your initialization code here */
  69. }
  70.  
  71. /*******************************************************************
  72.  *    This function is called in event loop to minimize memory
  73.  *******************************************************************/
  74.  
  75. UnloadSegs( int16 forceFlag )
  76. {
  77. int32    grow, max, memLeft;
  78.  
  79.     max = MaxMem( &grow );
  80.     CompactMem( 2048L*2048L );
  81.     
  82.     if( forceFlag || ShellPrefs.useMinMem )
  83.         {
  84.         /* Segments that contain Commands */
  85.         UnloadSeg( DoALIAS );
  86.         UnloadSeg( DoCAT );
  87.         UnloadSeg( DoCMP );
  88.         UnloadSeg( DoCRYPT );
  89.         UnloadSeg( DoDIFF );
  90.         UnloadSeg( DoMKDIR );
  91.         UnloadSeg( DoDF );
  92.         UnloadSeg( DoEJECT );
  93.         UnloadSeg( DoENVIRON );
  94.         UnloadSeg( DoCP );
  95.         UnloadSeg( DoFIND );
  96.         UnloadSeg( DoGREP );
  97.         UnloadSeg( DoHD );
  98.         UnloadSeg( DoFINFO );
  99.         UnloadSeg( DoLS );
  100.         UnloadSeg( DoECHO );
  101.         UnloadSeg( DoMVT );
  102.         UnloadSeg( DoCD );
  103.         UnloadSeg( DoPREFS );
  104.         UnloadSeg( DoLSR );
  105.         UnloadSeg( DoSETFILE );
  106.         UnloadSeg( DoSIZE );
  107.         UnloadSeg( DoSLEEP );
  108.         UnloadSeg( DoTOUCH );
  109.         UnloadSeg( DoTR );
  110.         UnloadSeg( DoUSAGE );
  111.         UnloadSeg( DoWC );
  112.  
  113.         /* Segments that contain internal Commands */
  114.         UnloadSeg( DoREAD );
  115.         UnloadSeg( DoLaunch );
  116.         UnloadSeg( DoSCRIPT );
  117.         UnloadSeg( DoSET );
  118.  
  119.         }
  120. }
  121.  
  122.